Integrand size = 28, antiderivative size = 92 \[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\frac {\cos (c+d x)}{a d}+\frac {\log (1-\cos (c+d x))}{2 (a+b) d}-\frac {\log (1+\cos (c+d x))}{2 (a-b) d}+\frac {b^3 \log (b+a \cos (c+d x))}{a^2 \left (a^2-b^2\right ) d} \]
[Out]
Time = 0.31 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4482, 2916, 12, 1643} \[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\frac {b^3 \log (a \cos (c+d x)+b)}{a^2 d \left (a^2-b^2\right )}+\frac {\log (1-\cos (c+d x))}{2 d (a+b)}-\frac {\log (\cos (c+d x)+1)}{2 d (a-b)}+\frac {\cos (c+d x)}{a d} \]
[In]
[Out]
Rule 12
Rule 1643
Rule 2916
Rule 4482
Rubi steps \begin{align*} \text {integral}& = \int \frac {\cos ^2(c+d x) \cot (c+d x)}{b+a \cos (c+d x)} \, dx \\ & = -\frac {a \text {Subst}\left (\int \frac {x^3}{a^3 (b+x) \left (a^2-x^2\right )} \, dx,x,a \cos (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {x^3}{(b+x) \left (a^2-x^2\right )} \, dx,x,a \cos (c+d x)\right )}{a^2 d} \\ & = -\frac {\text {Subst}\left (\int \left (-1+\frac {a^2}{2 (a+b) (a-x)}+\frac {a^2}{2 (a-b) (a+x)}+\frac {b^3}{(-a+b) (a+b) (b+x)}\right ) \, dx,x,a \cos (c+d x)\right )}{a^2 d} \\ & = \frac {\cos (c+d x)}{a d}+\frac {\log (1-\cos (c+d x))}{2 (a+b) d}-\frac {\log (1+\cos (c+d x))}{2 (a-b) d}+\frac {b^3 \log (b+a \cos (c+d x))}{a^2 \left (a^2-b^2\right ) d} \\ \end{align*}
Time = 0.54 (sec) , antiderivative size = 80, normalized size of antiderivative = 0.87 \[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\frac {\frac {\cos (c+d x)}{a}+\frac {\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{-a+b}+\frac {b^3 \log (b+a \cos (c+d x))}{a^4-a^2 b^2}+\frac {\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{a+b}}{d} \]
[In]
[Out]
Time = 1.13 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.92
method | result | size |
derivativedivides | \(\frac {\frac {\cos \left (d x +c \right )}{a}+\frac {b^{3} \ln \left (b +\cos \left (d x +c \right ) a \right )}{a^{2} \left (a +b \right ) \left (a -b \right )}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a +2 b}-\frac {\ln \left (\cos \left (d x +c \right )+1\right )}{2 a -2 b}}{d}\) | \(85\) |
default | \(\frac {\frac {\cos \left (d x +c \right )}{a}+\frac {b^{3} \ln \left (b +\cos \left (d x +c \right ) a \right )}{a^{2} \left (a +b \right ) \left (a -b \right )}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a +2 b}-\frac {\ln \left (\cos \left (d x +c \right )+1\right )}{2 a -2 b}}{d}\) | \(85\) |
risch | \(-\frac {i x b}{a^{2}}+\frac {{\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}+\frac {i x}{a -b}+\frac {i c}{d \left (a -b \right )}-\frac {i x}{a +b}-\frac {i c}{d \left (a +b \right )}-\frac {2 i b^{3} x}{a^{2} \left (a^{2}-b^{2}\right )}-\frac {2 i b^{3} c}{a^{2} d \left (a^{2}-b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d \left (a -b \right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d \left (a +b \right )}+\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{a^{2} d \left (a^{2}-b^{2}\right )}\) | \(228\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.07 \[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\frac {2 \, b^{3} \log \left (a \cos \left (d x + c\right ) + b\right ) + 2 \, {\left (a^{3} - a b^{2}\right )} \cos \left (d x + c\right ) - {\left (a^{3} + a^{2} b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a^{3} - a^{2} b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, {\left (a^{4} - a^{2} b^{2}\right )} d} \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\int \frac {\cos ^{2}{\left (c + d x \right )}}{a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}}\, dx \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.40 \[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\frac {\frac {b^{3} \log \left (a + b - \frac {{\left (a - b\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )}{a^{4} - a^{2} b^{2}} + \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a + b} + \frac {b \log \left (\frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + 1\right )}{a^{2}} + \frac {2}{a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (88) = 176\).
Time = 0.37 (sec) , antiderivative size = 190, normalized size of antiderivative = 2.07 \[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\frac {\frac {2 \, b^{3} \log \left ({\left | -a - b - \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} \right |}\right )}{a^{4} - a^{2} b^{2}} + \frac {\log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right )}{a + b} + \frac {2 \, b \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{a^{2}} - \frac {2 \, {\left (2 \, a - b + \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{a^{2} {\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1\right )}}}{2 \, d} \]
[In]
[Out]
Time = 23.64 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.27 \[ \int \frac {\cos ^2(c+d x)}{a \sin (c+d x)+b \tan (c+d x)} \, dx=\frac {2}{a\,d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d\,\left (a+b\right )}+\frac {b\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{a^2\,d}+\frac {b^3\,\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{a^2\,d\,\left (a^2-b^2\right )} \]
[In]
[Out]